<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>编辑图书</title>
	<!-- 静态包含头信息!-->
	<%@include file="/pages/common/hand.jsp"%>
<style type="text/css">
	h1 {
		text-align: center;
		margin-top: 200px;
	}
	
	h1 a {
		color:red;
	}
	
	input {
		text-align: center;
	}
</style>
	<script>
		//绑定单击事件,检查表单
		$(function () {
			$("#sub_btn1").click(function () {
				var name = $("#bookname").val();
				var price = $("#bookprice").val();
				var author = $("#bookauthor").val();
				var sales = $("#booksales").val();
				var stock = $("#bookstock").val();
				var numPutt = /^\d+$/;
				var moneyPutt = /^[0-9]+(.[0-9]{1,2})?$/;
				if (!moneyPutt.test(price) || !numPutt.test(sales) || !numPutt.test(stock)){
					alert("格式错误");
					return false;
				}else if(name==""||price==""||author==""||sales==""||stock==""){
					alert("格式错误");
					return false;
				}

			})
		})


	</script>
</head>
<body>
<h1>	</h1>
		<div id="header">
			<img class="logo_img" alt="" src="static/img/logo.jpg" >
			<span class="wel_word">编辑图书</span>
			<%@include file="/pages/common/manager_menu.jsp"%>
		</div>
		
		<div id="main">
			<form action="manager/bookservlet">
				<input type="hidden" name="pageOn" value="${requestScope.pageOn}">
				<input type="hidden" name="type" value="${requestScope.Mode}">
				<input type="hidden" name="id" value="${requestScope.quarybook.id}">
				<table>
					<tr>
						<td>名称</td>
						<td>价格</td>
						<td>作者</td>
						<td>销量</td>
						<td>库存</td>
						<td colspan="2">操作</td>
					</tr>

					<tr>
						<td><input name="name" type="text" value="${requestScope.quarybook.name}" id="bookname"></td>
						<td><input name="price" type="text" value="${requestScope.quarybook.price}" id="bookprice"></td>
						<td><input name="author" type="text" value="${requestScope.quarybook.author}" id="bookauthor"></td>
						<td><input name="sales" type="text" value="${requestScope.quarybook.sales}" id="booksales"></td>
						<td><input name="stock" type="text" value="${requestScope.quarybook.stock}" id="bookstock"></td>
						<td><input type="submit" id="sub_btn1" value="提交"/></td>
					</tr>	
				</table>
			</form>
			
	
		</div>
		
		<%@include file="/pages/common/footer.jsp"%>
</body>
</html>